//
// Created by huyi on 24-7-12.
//
#pragma once

#include <folly/dynamic.h>
#include <folly/io/async/AsyncSignalHandler.h>
#include <folly/logging/xlog.h>
#include <folly/ProducerConsumerQueue.h>

#include <boost/program_options.hpp>

namespace tradev::app {

/*!
st1 = streamTable(
  array(TIMESTAMP, 0, capacity) as DateTime,
  array(SYMBOL, 0, capacity) as Code,
  array(SYMBOL, 0, capacity) as Phase,
  array(DOUBLE, 0, capacity) as PreClose,
  array(DOUBLE, 0, capacity) as Open,
  array(DOUBLE, 0, capacity) as High,
  array(DOUBLE, 0, capacity) as Low,
  array(DOUBLE, 0, capacity) as Close,
  array(DOUBLE, 0, capacity) as Last,
  array(DOUBLE, 0, capacity) as BidPrice,
  array(LONG, 0, capacity) as BidVolume,
  array(DOUBLE, 0, capacity) as AskPrice,
  array(LONG, 0, capacity) as AskVolume,
  array(DOUBLE[], 0, capacity) as BidPrices,
  array(LONG[], 0, capacity) as BidVolumes,
  array(DOUBLE[], 0, capacity) as AskPrices,
  array(LONG[], 0, capacity) as AskVolumes,
  array(LONG, 0, capacity) as NumTrades,
  array(LONG, 0, capacity) as TotalVolumeTrade,
  array(DOUBLE, 0, capacity) as TotalValueTrade,
  array(LONG, 0, capacity) as TotalBidVolume,
  array(LONG, 0, capacity) as TotalAskVolume,
  array(DOUBLE, 0, capacity) as WeightedAvgBidPrice,
  array(DOUBLE, 0, capacity) as WeightedAvgAskPrice,
  array(DOUBLE, 0, capacity) as IOPV,
  array(DOUBLE, 0, capacity) as YieldToMaturity,
  array(DOUBLE, 0, capacity) as HighLimited,
  array(DOUBLE, 0, capacity) as LowLimited,
  array(SYMBOL, 0, capacity) as Status,
  array(DOUBLE, 0, capacity) as PreCloseIOPV,
  array(TIMESTAMP, 0, capacity) as LastTradeTime,
  array(SYMBOL, 0, capacity) as VarietyCategory
)
*/
enum Fields {
  kDateTime = 0,
  kCode,
  kPhase,
  kPreClose,
  kOpen,
  kHigh,
  kLow,
  kClose,
  kLast,
  kBidPrice,
  kBidVolume,
  kAskPrice,
  kAskVolume,
  kBidPrices,
  kBidVolumes,
  kAskPrices,
  kAskVolumes,
  kNumTrades,
  kTotalVolumeTrade,
  kTotalValueTrade,
  kTotalBidVolume,
  kTotalAskVolume,
  kWeightedAvgBidPrice,
  kWeightedAvgAskPrice,
  kIOPV,
  kYieldToMaturity,
  kHighLimited,
  kLowLimited,
  kStatus,
  kPreCloseIOPV,
  kLastTradeTime,
  kVarietyCategory
};

enum ItemTypes {
  kMdSnapshot = 0,
  kMdOptionSnapshot,
  kMdIndexSnapshot,
  kMdFutureSnapshot,
  kStopped = 99
};

using Args    = std::vector<std::string>;
using VMap    = boost::program_options::variables_map;
using Options = folly::dynamic;

} // namespace tradev::app
